package com.lostandfound.service.impl;

import com.lostandfound.mapper.EveryMapper;
import com.lostandfound.pojo.FindAny;
import com.lostandfound.pojo.Recruit;
import com.lostandfound.pojo.dto.Everything;
import com.lostandfound.service.EveryService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
@Slf4j
public class EveryServiceImpl implements EveryService {

    @Autowired
    private EveryMapper everyMapper;
    @Override
    public Object findById(Everything everything) {
        if (everything.getStamp()==1){
           FindAny findAny = everyMapper.findByFind(everything.getId());
            return findAny;
        }else if (everything.getStamp()==0){
            Recruit recruit = everyMapper.findByRecruit(everything.getId());
            return recruit;
        }
        return "查询失败";
    }
}
